<template>
  <el-pagination
    layout="  prev, pager, next "
    :page-size="page_size"
    @current-change="current_change"
    :current-page.sync="currentPage"
    :pager-count="5"
    :total="info.total"
    v-if="info.pages > 1"
  >
  </el-pagination>
</template>

<script>
export default {
  data() {
    return {
      info: [], //数据
      page_size: 8, //每页多少数据
      currentPage: 1, //默认当前页为第一页
    };
  },
  methods: {
    current_change(currentPage) {
      //改变当前页
      this.currentPage = currentPage;
    },
  },
};
</script>

<style scoped>
.pagination-container {
  background: #fff;
  padding: 32px 16px;
}
.pagination-container.hidden {
  display: none;
}
</style>
